package cc.mrbird.plan.service;

import cc.mrbird.plan.domain.Training;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

@CacheConfig(cacheNames = "TrainingeService")
public interface TrainingService {
  /*  List<Training> findTrainings(Training training, QueryRequest request);*/

  /*  Training findByName(String unit_name);*/
    @CacheEvict(allEntries = true)
    void add(Training training);
    @CacheEvict(key = "#p0", allEntries = true)
    void update(Training training);
    @CacheEvict(key = "#p0", allEntries = true)
    void delete(String ids);

    @Cacheable(key = "#p0")
    public Training findById(Integer id);
}
